using System.Text;
using Microsoft.AspNetCore.Mvc;

namespace WebAPI.MyEs.Controllers;

[ApiController]
[Route("api/[controller]")]
public class EsController : ControllerBase
{
    [HttpGet("date")]
    public string GetDate()
    {
        return DateTimeOffset.Now.ToString("yyyy-MM-dd HH:mm:ss");
    }
    /** 
        1. 本项目以学生管理系统为例，管理学生的各种信息
        2. 创建/删除/查询/学生索引
        3. 各种复杂查询
    */


    [HttpPost("create")]
    public void CreateIndex()
    {
        
    }

    [HttpDelete("delete")]
    public void DeleteIndex()
    {

    }


    [HttpPost]
    public string File01()
    {
        var ww = Request.Form.Files[0];
        var ss = ww.OpenReadStream();
        var buffer = new byte[4];
        ss.Read(buffer, 0, 4);
        var aaa = buffer[0].ToString() + buffer[1].ToString();
        var bbb = Encoding.ASCII.GetString(buffer);
        return aaa + '-' + bbb;
    }

}
